package com.situ.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.situ.web.service.IStudentService;
import com.situ.web.service.IUserService;
import com.situ.web.service.impl.UserServiceImpl;


public class AjaxServlet2 extends HttpServlet {
	private IUserService userService = new UserServiceImpl();
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String name = req.getParameter("name");
		boolean isExist = false;
		isExist = userService.checkName(name);
		resp.getWriter().write("{\"isExist\":"+isExist+"}");
	}

}
